POV-Ray : Newsgroups : povray.binaries.images : Bragging on : Bragging on Server Time
2 Nov 2024 14:16:07 EDT (-0400)
  Bragging on  
From: clipka
Date: 28 Aug 2010 11:35:31
Message: <4c792cc3@news.povray.org>
To add to my recent brags, here's focal blur:

Image #1 shows a scene rendered with original POV-Ray 3.7 beta 38; scene 
is the default "checkered plane" scene template, with focal blur enabled 
in the camera, and an additional highly emissive small sphere to show 
the bokeh:

   camera {
     ...
     focal_point <0,0,0>
     aperture 0.5
     blur_samples 1000
     confidence 0.95
     variance 1/200
   }

   sphere {              // emissive sphere
     <-2,-0.95,2>, 0.05
     texture {
       pigment { color rgb <1,1,1> }
       finish { emission 10.0 diffuse 0 ambient 0 specular 0 }
     }
   }


One nasty, clearly visible thing about POV-Ray's focal blur is the 
square-ish bokeh. Occasionally you might also see six-pointed stars, but 
most of all you have virtually zero control over this.

The reason for this is that POV-Ray does have a set of hexagonal bokehs, 
from which it chooses depending on the blur_samples setting, but to 
"fill up" to the specified blur_samples, it just fills a 2D square with 
random samples.


Another nasty thing are the occasional non-blurred pixels among the 
blurred behind the reflective sphere. Do what you will, you just can't 
get rid of them, no matter how high you crank the focal blur settings.

The reason for this is that these are pixels where POV-Ray takes just 7 
samples, then calls it a day because they happen to be almost exactly 
the same.


Image #2 shows the same scene rendered with a modified version of beta 
38, using the following changes:

* Additional samples are not taken randomly from a square, but using a 
sequence of low-discrepancy points on a disc instead (based on a Halton 
sequence).

* The "blur_samples" keyword optionally takes two parameters, in which 
case the first one specifies a /minimum/ number of samples to take, 
regardless of confidence and variance settings; in this particular 
render, this was set to "blur_samples 20, 1000".

Note how this replaces the square-ish bokeh with a more pleasing round 
one, and also avoids the occasional non-blurred pixel.


Another thing you may notice is that in image #2 the horizon appears to 
be somewhat higher than in #1, as if the image was taken from a slightly 
different camera location. In fact, this is not far from the truth, 
because I changed yet another thing:

* When "filling up" the hard-coded bokehs with additional (sub-)random 
samples, POV-Ray makes sure not to get too close to the hard-coded 
samples or already-added samples; unfortunately, it does this by 
modifying the direction, in a way that creates a bias downwards and to 
the right. I changed this to simply pick a new (sub-)random point instead.


Post a reply to this message


Attachments:
Download 'focal_blur_test_38.png' (266 KB) Download 'focal_blur_test_38plus.png' (258 KB)

Preview of image 'focal_blur_test_38.png'
focal_blur_test_38.png

Preview of image 'focal_blur_test_38plus.png'
focal_blur_test_38plus.png


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.